﻿using Airon.Extras.DatabaseAccessor.Dapper.Internal;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Airon.Dapper.Internal
{
    /// <summary>
    /// 数据库连接配置
    /// </summary>
    public class IDbConnectionConfig
    {
        /// <summary>
        /// 数据库连接类型
        /// </summary>
        public SqlDataBaseConfig.DbType _dbType { get; set; }
        /// <summary>
        /// 数据库连接字符串
        /// </summary>
        public string _db { get; set; }
        /// <summary>
        /// 初始化主数据库连接配置 通常是单独数据库
        /// </summary>
        /// <param name="db"></param>
        public IDbConnectionConfig(string db)
        {
            this._db = db;
            this._dbType = SqlDataBaseConfig.DbType.Master;
        }
        /// <summary>
        /// 初始化数据库连接配置 通常是多独数据库
        /// </summary>
        /// <param name="db">,数据库连接</param>
        /// <param name="dbtype">数据库类型 主库 从库</param>
        public IDbConnectionConfig(SqlDataBaseConfig.DbType dbtype, string db)
        {
            this._db = db;
            this._dbType = dbtype;
        }
    }

}
